<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/v2/console/common/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<title>添加公司信息</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style>
html, body, #container {
	width: 100%;
	height: 100%;
}
</style>
<link rel="stylesheet" href="${path}/v2/console/css/base.css">
<link rel="stylesheet" href="${path}/v2/console/css/style.css">
<link rel="stylesheet"
	href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
<script
	src="https://webapi.amap.com/maps?v=1.4.14&key=	4351c006b95de19444e1ef36ccf595cc&plugin=AMap.PolyEditor"></script>
<script
	src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
<script src="${path}/v2/console/js/jquery-1.9.1.min.js"></script>
<script src="${path}/v2/console/My97DatePicker/WdatePicker.js"></script>
<script src="${path}/v2/console/js/jquery.form.js"></script>
<script type="text/javascript"
	src="${path}/kindeditor/kindeditor-min.js"></script>

</head>
<body>
	<div id="wrapper">
		<div class="main">
			<div class="main-right">
				<div class="column-name">
					<h2>
						店铺管理 > <b>添加信息</b>
					</h2>
				</div>
				<div class="form">
					<form id="aform" action="/shop/addShop.html" method="post"
						enctype="multipart/form-data">
						<input type="hidden" name="shopName" id="shopName" value="">
						<input type="hidden" name="shopAdress" id="shopAdress" value="">
						<input type="hidden" name="keyword" id="keyword" value="">
						<input type="hidden" name="sort" id="sort" value="">
						<input type="hidden" id="coordinate" name="coordinate" value="">
					</form>
					<input type="hidden" id="target" name="target" value="-1">
					<div class="form-item">
						<div class="form-name">商铺名称：</div>
						<div class="form-input">
							<input AutoComplete="off" type="text" class="input" id="shopName1"
								name="shopName1" value="">
							<div class="clearfix"></div>
							<div class="form-msg hide" style="color: red;"></div>
						</div>
					</div>

					<div class="form-item">
						<div class="form-name">商铺地址：</div>
						<div class="form-input">
							<input AutoComplete="off" type="text" class="input" id="shopAdress1"
								name="shopAdress1" value="">
							<div class="clearfix"></div>
							<div class="form-msg hide" style="color: red;"></div>
						</div>
					</div>
					<div class="form-item">
						<div class="form-name">关键字设置：</div>
						<div class="form-input">
							<input AutoComplete="off" type="text" class="input" id="keyword1"
								name="keyword1" value="">
							<div class="clearfix"></div>
							<div class="form-msg hide" style="color: red;"></div>
						</div>
					</div>
					<div class="form-item">
						<div class="form-name">店铺排序：</div>
						<div class="form-input">
							<input AutoComplete="off" type="number" class="input" id="sort1"
								name="sort1" value="">
							<div class="clearfix"></div>
							<div class="form-msg hide" style="color: red;"></div>
						</div>
					</div>
					<div class="form-item">
						<div class="form-name">坐标：</div>
						<div class="form-input">
							<input AutoComplete="off" type="text" disabled="disabled" class="input" id="target1"
								name="target1" value="">
							<div class="clearfix"></div>
							<div class="form-msg hide" style="color: red;"></div>
						</div>
					</div>
					<div class="form-item" style="" : 20px>
						<div class="form-name">区域地图设置：</div>
						<div class="form-input form-map">
							<div id="container" style="width: 90%; height: 400px;"></div>
							<style>
.form-map .input-card {
	height: 100px;
	justify-content: center;
	bottom: 1px;
	right: calc(10% + 1px) !important;
	width: 120px;
	position: absolute;
}

.form-map .input-card .btn {
	margin: 0
}
</style>
						</div>
					</div>

					<button onclick="addInfo()" class="btn w144">保 存</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
	//初始化地图对象，加载地图
	var map = new AMap.Map("container", {
	    center: [115.857342,28.621288],
	    zoom: 11
	});
	
	function showInfoClick(e){
		$("#target1").val(e.lnglat.getLng()+','+e.lnglat.getLat());
	    
	}
	map.on('click', showInfoClick);
	// 解绑事件

	function addInfo(){
		var shopName1 = $("#shopName1").val();
		var shopAdress1 = $("#shopAdress1").val();
		var keyword1 = $("#keyword1").val();
		var sort1 = $("#sort1").val();
		var target1 = $("#target1").val();
		if(target1.length == 0){
			alert("请点击获取坐标")
		}else{
			$("#shopName").val(shopName1);
			$("#shopAdress").val(shopAdress1);
			$("#keyword").val(keyword1);
			$("#sort").val(sort1);
			$("#coordinate").val(target1);
			$("#aform").submit();
		}
		
	}
</script>
